<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%

String path = request.getContextPath();
	String BasePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>



<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>川轻化健身房</title>
  <meta name="description" content="Ela Admin - HTML5 Admin Template">
    <meta name="viewport" content="width=device-width, initial-scale=1">



<link href="<%=BasePath%>/static/time/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
<link rel="stylesheet" href="<%=BasePath%>/stati/cassets/css/normalize.css">
<link rel="stylesheet" href="<%=BasePath%>/static/assets/css/bootstrap.min.css">
<link rel="stylesheet" href="<%=BasePath%>/static/assets/css/font-awesome.min.css">
<link rel="stylesheet" href="<%=BasePath%>/static/assets/css/themify-icons.css">
<link rel="stylesheet" href="<%=BasePath%>/static/assets/css/style.css">
<link rel="stylesheet" href="<%=BasePath%>/static/vendor/bootstrap/css/bootstrap.css" />
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800' rel='stylesheet' type='text/css'>
<script type="text/javascript"
	src="<%=BasePath%>/static/vendor/jquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript"
	src="<%=BasePath%>/static/vendor/bootstrap/js/bootstrap.min.js"></script>

</head>
<div class="modal fade" id="readerUpdateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">

                <h1 class="modal-title" align="center"><strong>管理员登录</strong></h1>

                <form class="fh5co-form" id="defaultForm" >

                    <h3 >账号</h3>
                    <div class="form-group">
                        <div class="input-group">
                            <div class="input-group-addon"><i class="fa fa-user"></i></div>
                            <input type="text"  class="form-control" id="username"   >

                        </div>
                    </div>

                    <h3 >密码</h3>
                    <div class="form-group">
                        <div class="input-group">
                            <div class="input-group-addon"><i class="fa fa-user"></i></div>
                            <input type="password"  class="form-control" id="password" >
                        </div>
                    </div>
                    <button type="button" class="btn btn-warning btn-lg btn-block" id="validateBtn" name="validateBtn">登录</button>
                </form>



            </div>
        </div>
    </div>
</div>
<body>


    <script src="<%=BasePath%>/static/assets/js/vendor/jquery-2.1.4.min.js"></script>
    <script src="<%=BasePath%>/static/assets/js/popper.min.js"></script>
    <script src="<%=BasePath%>/static/assets/js/bootstrap.min.js"></script>
    <script src="<%=BasePath%>/static/assets/js/jquery.matchHeight.min.js"></script>
    <script src="<%=BasePath%>/static/assets/js/main.js"></script>
    <script type="text/javascript" src="<%=BasePath%>/static/time/jquery/jquery-1.8.3.min.js" charset="UTF-8"></script>
    <script type="text/javascript" src="<%=BasePath%>/static/time/bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="<%=BasePath%>/static/time/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
    <script type="text/javascript" src="<%=BasePath%>/static/time/js/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <script type="text/javascript">
        $(document).ready(function () {
           $("#readerUpdateModal").modal({
               backdrop:"static"
           });
        });
        $(document).on("click","#validateBtn",function () {
            var username = $("#username").val();
            var password = $("#password").val();
            if(username == "" || password == ""){
                alert("账号或密码不能为空");
                return;
            }
            $.ajax({
                url:"../admin/login",
                data:{
                    username:username,
                    password:password
                },
                type:"post",
                success:function (data) {
                    if(data.msg == "success"){
                        window.location.href="../admin/index";
                        return ;
                    }else{
                        alert(data.msg);
                    }
                }
            })
        })
    </script>

</body>
</html>
